package br.com.comanda.webservice.persistence;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;

public class HibernateUtil {

	private static SessionFactory factory;
	private static AnnotationConfiguration configuration;
	
	static {
		
		configuration = new AnnotationConfiguration();
		configuration.configure();
		factory = configuration.buildSessionFactory();
	}
	
	public static Session getSession() {
		return factory.openSession();
	}
	
}
